package com.itheima.examination3;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DormitoryManagement2 {
    public static void main(String[] args) {
        //题目
        //要求：

        //1.创建Map集合，键是宿舍号，值是宿舍里住的4个学生
        Map<String, List<Student>> stuMap = new HashMap<>();

        stuMap.put("101", List.of(new Student("张三", 18), new Student("李四", 19)));
        stuMap.put("102", List.of(new Student("王五", 18), new Student("赵六", 20)));

        //2.遍历Map集合
        stuMap.forEach((k, v) -> {
            System.out.println(k + ": " + v);
        });
    }
}
